package healththink



import grails.test.mixin.*
import org.junit.*

/**
 * See the API for {@link grails.test.mixin.domain.DomainClassUnitTestMixin} for usage instructions
 */
@TestFor(FacilityGroup)
class FacilityGroupTests {

    void testFacilityGroup() {
       assertNotNull("Facility Group Not Null?", HealthThink.getStaticFacilityGroup())
	   
	   FacilityGroup target = HealthThink.getStaticFacilityGroup()
	   assertNotNull("(error)FacilityGroup Target Null", target)
	   assertNotNull("(error)FacilityGroup Validation Was Successfull", target.validate())
	   
	   //must be able to save this, is parent
	   target = target.save(flush:true)
	   FacilityGroup expected = FacilityGroup.findById(target.id)
	   
	   assertNotNull("(error)FacilityGroup Target was not saved", target)
	   assertNotNull("(error)Expected FacilityGroup was null", expected)
	   assertEquals("(error) FacilityGroup target not equal to expected.", target, expected)
	   
	   target.delete(flush:true)
    }
}
